import {useContext} from 'react'
import Button from 'src/components/Button'
import {context} from './Provider'

export default function Counter() {
  const {counter, increment, decrement} = useContext(context)
  return (
    <div>
      <div>{counter}</div>
      <Button onClick={increment}>递增</Button>
      <Button onClick={decrement}>递减</Button>
    </div>
  )
}
